FROM eclipse-temurin:17-jre-alpine

#FROM docker.1ms.run/meddream/jdk17:latest

# 环境变量
ENV WORK_PATH /home/project/fawkes
ENV APP_NAME @project.build.finalName@.@project.packaging@
ENV APP_VERSION @project.version@

EXPOSE 8080
#USER
#USER user:group
#VOLUME
VOLUME ["/home/project", "/tmp/data"]

# 拷贝JAR文件
COPY $APP_NAME $WORK_PATH/

# 设置工作目录
WORKDIR $WORK_PATH

# 设置时区为上海时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom"]

CMD ["-jar", "-Xms512m", "-Xmx1024m", "-XX:MaxMetaspaceSize=256m", "-XX:+UseG1GC", "@project.build.finalName@.@project.packaging@"]